/******************************************************************************
 *
 * Copyright(c) 2016 - 2017 Realtek Corporation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of version 2 of the GNU General Public License as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 ******************************************************************************/

#ifndef _HAL_FWOFFLOADC2HFORMAT_H2C_C2H_AP_H_
#define _HAL_FWOFFLOADC2HFORMAT_H2C_C2H_AP_H_
#define C2H_SUB_CMD_ID_C2H_DBG  0X00
#define C2H_SUB_CMD_ID_BT_COEX_INFO  0X02
#define C2H_SUB_CMD_ID_SCAN_STATUS_RPT  0X03
#define C2H_SUB_CMD_ID_H2C_ACK_HDR  0X01
#define C2H_SUB_CMD_ID_CFG_PARAMETER_ACK  0X01
#define C2H_SUB_CMD_ID_BT_COEX_ACK  0X01
#define C2H_SUB_CMD_ID_DUMP_PHYSICAL_EFUSE_ACK  0X01
#define C2H_SUB_CMD_ID_UPDATE_PACKET_ACK  0X01
#define C2H_SUB_CMD_ID_UPDATE_DATAPACK_ACK  0X01
#define C2H_SUB_CMD_ID_RUN_DATAPACK_ACK  0X01
#define C2H_SUB_CMD_ID_CHANNEL_SWITCH_ACK  0X01
#define C2H_SUB_CMD_ID_IQK_ACK  0X01
#define C2H_SUB_CMD_ID_POWER_TRACKING_ACK  0X01
#define C2H_SUB_CMD_ID_PSD_ACK  0X01
#define C2H_SUB_CMD_ID_PSD_DATA  0X04
#define C2H_SUB_CMD_ID_EFUSE_DATA  0X05
#define C2H_SUB_CMD_ID_IQK_DATA  0X06
#define C2H_SUB_CMD_ID_C2H_PKT_FTM_DBG   0X07
#define C2H_SUB_CMD_ID_C2H_PKT_FTM_2_DBG  0X08
#define C2H_SUB_CMD_ID_C2H_PKT_FTM_3_DBG  0X09
#define C2H_SUB_CMD_ID_C2H_PKT_FTM_4_DBG    0X0A
#define C2H_SUB_CMD_ID_FTMACKRPT_HDL_DBG  0X0B
#define C2H_SUB_CMD_ID_FTMC2H_RPT        0X0C
#define C2H_SUB_CMD_ID_DRVFTMC2H_RPT  0X0D
#define C2H_SUB_CMD_ID_C2H_PKT_FTM_5_DBG  0X0E
#define C2H_SUB_CMD_ID_CCX_RPT  0X0F
#define C2H_SUB_CMD_ID_C2H_PKT_NAN_RPT  0X10
#define C2H_SUB_CMD_ID_C2H_PKT_ATM_RPT  0X11
#define C2H_SUB_CMD_ID_C2H_PKT_FTMSESSION_END  0X1C
#define C2H_SUB_CMD_ID_C2H_PKT_DETECT_THERMAL  0X1D
#define C2H_SUB_CMD_ID_FW_DBG_MSG  0XFF
#define C2H_SUB_CMD_ID_FW_SNDING_ACK  0X01
#define C2H_SUB_CMD_ID_FW_FWCTRL_RPT  0X1F
#define C2H_SUB_CMD_ID_H2C_LOOPBACK_ACK  0X20
#define C2H_SUB_CMD_ID_FWCMD_LOOPBACK_ACK  0X21
#define H2C_SUB_CMD_ID_CFG_PARAMETER_ACK SUB_CMD_ID_CFG_PARAMETER
#define H2C_SUB_CMD_ID_BT_COEX_ACK SUB_CMD_ID_BT_COEX
#define H2C_SUB_CMD_ID_DUMP_PHYSICAL_EFUSE_ACK SUB_CMD_ID_DUMP_PHYSICAL_EFUSE
#define H2C_SUB_CMD_ID_UPDATE_PACKET_ACK SUB_CMD_ID_UPDATE_PACKET
#define H2C_SUB_CMD_ID_UPDATE_DATAPACK_ACK SUB_CMD_ID_UPDATE_DATAPACK
#define H2C_SUB_CMD_ID_RUN_DATAPACK_ACK SUB_CMD_ID_RUN_DATAPACK
#define H2C_SUB_CMD_ID_CHANNEL_SWITCH_ACK SUB_CMD_ID_CHANNEL_SWITCH
#define H2C_SUB_CMD_ID_IQK_ACK SUB_CMD_ID_IQK
#define H2C_SUB_CMD_ID_POWER_TRACKING_ACK SUB_CMD_ID_POWER_TRACKING
#define H2C_SUB_CMD_ID_PSD_ACK SUB_CMD_ID_PSD
#define H2C_SUB_CMD_ID_CCX_RPT SUB_CMD_ID_CCX_RPT
#define H2C_SUB_CMD_ID_FW_DBG_MSG SUB_CMD_ID_FW_DBG_MSG
#define H2C_SUB_CMD_ID_FW_SNDING_ACK SUB_CMD_ID_FW_SNDING
#define H2C_SUB_CMD_ID_FW_FWCTRL_RPT SUB_CMD_ID_FW_FWCTRL_RPT
#define H2C_SUB_CMD_ID_H2C_LOOPBACK_ACK SUB_CMD_ID_H2C_LOOPBACK
#define H2C_SUB_CMD_ID_FWCMD_LOOPBACK_ACK SUB_CMD_ID_FWCMD_LOOPBACK
#define H2C_CMD_ID_CFG_PARAMETER_ACK  0XFF
#define H2C_CMD_ID_BT_COEX_ACK  0XFF
#define H2C_CMD_ID_DUMP_PHYSICAL_EFUSE_ACK  0XFF
#define H2C_CMD_ID_UPDATE_PACKET_ACK  0XFF
#define H2C_CMD_ID_UPDATE_DATAPACK_ACK  0XFF
#define H2C_CMD_ID_RUN_DATAPACK_ACK  0XFF
#define H2C_CMD_ID_CHANNEL_SWITCH_ACK  0XFF
#define H2C_CMD_ID_IQK_ACK  0XFF
#define H2C_CMD_ID_POWER_TRACKING_ACK  0XFF
#define H2C_CMD_ID_PSD_ACK  0XFF
#define H2C_CMD_ID_CCX_RPT  0XFF
#define H2C_CMD_ID_FW_DBG_MSG  0XFF
#define H2C_CMD_ID_FW_SNDING_ACK  0XFF
#define H2C_CMD_ID_FW_FWCTRL_RPT  0XFF
#define H2C_CMD_ID_H2C_LOOPBACK_ACK  0XFF
#define H2C_CMD_ID_FWCMD_LOOPBACK_ACK  0XFF
#define C2H_HDR_GET_CMD_ID(__pC2H)    GET_C2H_FIELD(__pC2H + 0X00, 0, 8)
#define C2H_HDR_SET_CMD_ID(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X00, 0, 8, __Value)
#define C2H_HDR_SET_CMD_ID_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X00, 0, 8, __Value)
#define C2H_HDR_GET_SEQ(__pC2H)    GET_C2H_FIELD(__pC2H + 0X00, 8, 8)
#define C2H_HDR_SET_SEQ(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X00, 8, 8, __Value)
#define C2H_HDR_SET_SEQ_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X00, 8, 8, __Value)
#define C2H_HDR_GET_C2H_SUB_CMD_ID(__pC2H)    GET_C2H_FIELD(__pC2H + 0X00, 16, 8)
#define C2H_HDR_SET_C2H_SUB_CMD_ID(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X00, 16, 8, __Value)
#define C2H_HDR_SET_C2H_SUB_CMD_ID_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X00, 16, 8, __Value)
#define C2H_HDR_GET_LEN(__pC2H)    GET_C2H_FIELD(__pC2H + 0X00, 24, 8)
#define C2H_HDR_SET_LEN(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X00, 24, 8, __Value)
#define C2H_HDR_SET_LEN_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X00, 24, 8, __Value)
#define C2H_DBG_GET_DBG_MSG(__pC2H)    GET_C2H_FIELD(__pC2H + 0X04, 0, 8)
#define C2H_DBG_SET_DBG_MSG(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X04, 0, 8, __Value)
#define C2H_DBG_SET_DBG_MSG_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X04, 0, 8, __Value)
#define BT_COEX_INFO_GET_DATA_START(__pC2H)    GET_C2H_FIELD(__pC2H + 0X04, 0, 8)
#define BT_COEX_INFO_SET_DATA_START(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X04, 0, 8, __Value)
#define BT_COEX_INFO_SET_DATA_START_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X04, 0, 8, __Value)
#define SCAN_STATUS_RPT_GET_H2C_RETURN_CODE(__pC2H)    GET_C2H_FIELD(__pC2H + 0X04, 0, 8)
#define SCAN_STATUS_RPT_SET_H2C_RETURN_CODE(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X04, 0, 8, __Value)
#define SCAN_STATUS_RPT_SET_H2C_RETURN_CODE_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X04, 0, 8, __Value)
#define SCAN_STATUS_RPT_GET_H2C_SEQ(__pC2H)    GET_C2H_FIELD(__pC2H + 0X04, 16, 16)
#define SCAN_STATUS_RPT_SET_H2C_SEQ(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X04, 16, 16, __Value)
#define SCAN_STATUS_RPT_SET_H2C_SEQ_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X04, 16, 16, __Value)
#define H2C_ACK_HDR_GET_H2C_RETURN_CODE(__pC2H)    GET_C2H_FIELD(__pC2H + 0X04, 0, 8)
#define H2C_ACK_HDR_SET_H2C_RETURN_CODE(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X04, 0, 8, __Value)
#define H2C_ACK_HDR_SET_H2C_RETURN_CODE_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X04, 0, 8, __Value)
#define H2C_ACK_HDR_GET_H2C_CMD_ID(__pC2H)    GET_C2H_FIELD(__pC2H + 0X04, 8, 8)
#define H2C_ACK_HDR_SET_H2C_CMD_ID(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X04, 8, 8, __Value)
#define H2C_ACK_HDR_SET_H2C_CMD_ID_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X04, 8, 8, __Value)
#define H2C_ACK_HDR_GET_H2C_SUB_CMD_ID(__pC2H)    GET_C2H_FIELD(__pC2H + 0X04, 16, 16)
#define H2C_ACK_HDR_SET_H2C_SUB_CMD_ID(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X04, 16, 16, __Value)
#define H2C_ACK_HDR_SET_H2C_SUB_CMD_ID_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X04, 16, 16, __Value)
#define H2C_ACK_HDR_GET_H2C_SEQ(__pC2H)    GET_C2H_FIELD(__pC2H + 0X08, 0, 16)
#define H2C_ACK_HDR_SET_H2C_SEQ(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X08, 0, 16, __Value)
#define H2C_ACK_HDR_SET_H2C_SEQ_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X08, 0, 16, __Value)
#define CFG_PARAMETER_ACK_GET_OFFSET_ACCUMULATION(__pC2H)    GET_C2H_FIELD(__pC2H + 0XC, 0, 32)
#define CFG_PARAMETER_ACK_SET_OFFSET_ACCUMULATION(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0XC, 0, 32, __Value)
#define CFG_PARAMETER_ACK_SET_OFFSET_ACCUMULATION_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0XC, 0, 32, __Value)
#define CFG_PARAMETER_ACK_GET_VALUE_ACCUMULATION(__pC2H)    GET_C2H_FIELD(__pC2H + 0X10, 0, 32)
#define CFG_PARAMETER_ACK_SET_VALUE_ACCUMULATION(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X10, 0, 32, __Value)
#define CFG_PARAMETER_ACK_SET_VALUE_ACCUMULATION_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X10, 0, 32, __Value)
#define BT_COEX_ACK_GET_DATA_START(__pC2H)    GET_C2H_FIELD(__pC2H + 0XC, 0, 8)
#define BT_COEX_ACK_SET_DATA_START(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0XC, 0, 8, __Value)
#define BT_COEX_ACK_SET_DATA_START_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0XC, 0, 8, __Value)
#define PSD_DATA_GET_SEGMENT_ID(__pC2H)    GET_C2H_FIELD(__pC2H + 0X04, 0, 7)
#define PSD_DATA_SET_SEGMENT_ID(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X04, 0, 7, __Value)
#define PSD_DATA_SET_SEGMENT_ID_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X04, 0, 7, __Value)
#define PSD_DATA_GET_END_SEGMENT(__pC2H)    GET_C2H_FIELD(__pC2H + 0X04, 7, 1)
#define PSD_DATA_SET_END_SEGMENT(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X04, 7, 1, __Value)
#define PSD_DATA_SET_END_SEGMENT_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X04, 7, 1, __Value)
#define PSD_DATA_GET_SEGMENT_SIZE(__pC2H)    GET_C2H_FIELD(__pC2H + 0X04, 8, 8)
#define PSD_DATA_SET_SEGMENT_SIZE(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X04, 8, 8, __Value)
#define PSD_DATA_SET_SEGMENT_SIZE_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X04, 8, 8, __Value)
#define PSD_DATA_GET_TOTAL_SIZE(__pC2H)    GET_C2H_FIELD(__pC2H + 0X04, 16, 16)
#define PSD_DATA_SET_TOTAL_SIZE(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X04, 16, 16, __Value)
#define PSD_DATA_SET_TOTAL_SIZE_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X04, 16, 16, __Value)
#define PSD_DATA_GET_H2C_SEQ(__pC2H)    GET_C2H_FIELD(__pC2H + 0X8, 0, 16)
#define PSD_DATA_SET_H2C_SEQ(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X8, 0, 16, __Value)
#define PSD_DATA_SET_H2C_SEQ_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X8, 0, 16, __Value)
#define PSD_DATA_GET_DATA_START(__pC2H)    GET_C2H_FIELD(__pC2H + 0X8, 16, 8)
#define PSD_DATA_SET_DATA_START(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X8, 16, 8, __Value)
#define PSD_DATA_SET_DATA_START_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X8, 16, 8, __Value)
#define EFUSE_DATA_GET_SEGMENT_ID(__pC2H)    GET_C2H_FIELD(__pC2H + 0X04, 0, 7)
#define EFUSE_DATA_SET_SEGMENT_ID(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X04, 0, 7, __Value)
#define EFUSE_DATA_SET_SEGMENT_ID_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X04, 0, 7, __Value)
#define EFUSE_DATA_GET_END_SEGMENT(__pC2H)    GET_C2H_FIELD(__pC2H + 0X04, 7, 1)
#define EFUSE_DATA_SET_END_SEGMENT(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X04, 7, 1, __Value)
#define EFUSE_DATA_SET_END_SEGMENT_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X04, 7, 1, __Value)
#define EFUSE_DATA_GET_SEGMENT_SIZE(__pC2H)    GET_C2H_FIELD(__pC2H + 0X04, 8, 8)
#define EFUSE_DATA_SET_SEGMENT_SIZE(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X04, 8, 8, __Value)
#define EFUSE_DATA_SET_SEGMENT_SIZE_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X04, 8, 8, __Value)
#define EFUSE_DATA_GET_TOTAL_SIZE(__pC2H)    GET_C2H_FIELD(__pC2H + 0X04, 16, 16)
#define EFUSE_DATA_SET_TOTAL_SIZE(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X04, 16, 16, __Value)
#define EFUSE_DATA_SET_TOTAL_SIZE_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X04, 16, 16, __Value)
#define EFUSE_DATA_GET_H2C_SEQ(__pC2H)    GET_C2H_FIELD(__pC2H + 0X8, 0, 16)
#define EFUSE_DATA_SET_H2C_SEQ(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X8, 0, 16, __Value)
#define EFUSE_DATA_SET_H2C_SEQ_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X8, 0, 16, __Value)
#define EFUSE_DATA_GET_DATA_START(__pC2H)    GET_C2H_FIELD(__pC2H + 0X8, 16, 8)
#define EFUSE_DATA_SET_DATA_START(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X8, 16, 8, __Value)
#define EFUSE_DATA_SET_DATA_START_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X8, 16, 8, __Value)
#define IQK_DATA_GET_SEGMENT_ID(__pC2H)    GET_C2H_FIELD(__pC2H + 0X04, 0, 7)
#define IQK_DATA_SET_SEGMENT_ID(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X04, 0, 7, __Value)
#define IQK_DATA_SET_SEGMENT_ID_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X04, 0, 7, __Value)
#define IQK_DATA_GET_END_SEGMENT(__pC2H)    GET_C2H_FIELD(__pC2H + 0X04, 7, 1)
#define IQK_DATA_SET_END_SEGMENT(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X04, 7, 1, __Value)
#define IQK_DATA_SET_END_SEGMENT_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X04, 7, 1, __Value)
#define IQK_DATA_GET_SEGMENT_SIZE(__pC2H)    GET_C2H_FIELD(__pC2H + 0X04, 8, 8)
#define IQK_DATA_SET_SEGMENT_SIZE(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X04, 8, 8, __Value)
#define IQK_DATA_SET_SEGMENT_SIZE_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X04, 8, 8, __Value)
#define IQK_DATA_GET_TOTAL_SIZE(__pC2H)    GET_C2H_FIELD(__pC2H + 0X04, 16, 16)
#define IQK_DATA_SET_TOTAL_SIZE(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X04, 16, 16, __Value)
#define IQK_DATA_SET_TOTAL_SIZE_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X04, 16, 16, __Value)
#define IQK_DATA_GET_H2C_SEQ(__pC2H)    GET_C2H_FIELD(__pC2H + 0X8, 0, 16)
#define IQK_DATA_SET_H2C_SEQ(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X8, 0, 16, __Value)
#define IQK_DATA_SET_H2C_SEQ_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X8, 0, 16, __Value)
#define IQK_DATA_GET_DATA_START(__pC2H)    GET_C2H_FIELD(__pC2H + 0X8, 16, 8)
#define IQK_DATA_SET_DATA_START(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X8, 16, 8, __Value)
#define IQK_DATA_SET_DATA_START_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X8, 16, 8, __Value)
#define CCX_RPT_GET_POLLUTED(__pC2H)    GET_C2H_FIELD(__pC2H + 0X4, 0, 1)
#define CCX_RPT_SET_POLLUTED(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X4, 0, 1, __Value)
#define CCX_RPT_SET_POLLUTED_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X4, 0, 1, __Value)
#define CCX_RPT_GET_RPT_SEL(__pC2H)    GET_C2H_FIELD(__pC2H + 0X4, 5, 3)
#define CCX_RPT_SET_RPT_SEL(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X4, 5, 3, __Value)
#define CCX_RPT_SET_RPT_SEL_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X4, 5, 3, __Value)
#define CCX_RPT_GET_QSEL(__pC2H)    GET_C2H_FIELD(__pC2H + 0X4, 8, 5)
#define CCX_RPT_SET_QSEL(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X4, 8, 5, __Value)
#define CCX_RPT_SET_QSEL_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X4, 8, 5, __Value)
#define CCX_RPT_GET_MISSED_RPT_NUM(__pC2H)    GET_C2H_FIELD(__pC2H + 0X4, 13, 3)
#define CCX_RPT_SET_MISSED_RPT_NUM(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X4, 13, 3, __Value)
#define CCX_RPT_SET_MISSED_RPT_NUM_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X4, 13, 3, __Value)
#define CCX_RPT_GET_MACID(__pC2H)    GET_C2H_FIELD(__pC2H + 0X4, 16, 7)
#define CCX_RPT_SET_MACID(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X4, 16, 7, __Value)
#define CCX_RPT_SET_MACID_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X4, 16, 7, __Value)
#define CCX_RPT_GET_INITIAL_DATA_RATE(__pC2H)    GET_C2H_FIELD(__pC2H + 0X4, 24, 7)
#define CCX_RPT_SET_INITIAL_DATA_RATE(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X4, 24, 7, __Value)
#define CCX_RPT_SET_INITIAL_DATA_RATE_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X4, 24, 7, __Value)
#define CCX_RPT_GET_INITIAL_SGI(__pC2H)    GET_C2H_FIELD(__pC2H + 0X4, 31, 1)
#define CCX_RPT_SET_INITIAL_SGI(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X4, 31, 1, __Value)
#define CCX_RPT_SET_INITIAL_SGI_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X4, 31, 1, __Value)
#define CCX_RPT_GET_QUEUE_TIME(__pC2H)    GET_C2H_FIELD(__pC2H + 0X8, 0, 16)
#define CCX_RPT_SET_QUEUE_TIME(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X8, 0, 16, __Value)
#define CCX_RPT_SET_QUEUE_TIME_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X8, 0, 16, __Value)
#define CCX_RPT_GET_SW_DEFINE_BYTE0(__pC2H)    GET_C2H_FIELD(__pC2H + 0X8, 16, 8)
#define CCX_RPT_SET_SW_DEFINE_BYTE0(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X8, 16, 8, __Value)
#define CCX_RPT_SET_SW_DEFINE_BYTE0_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X8, 16, 8, __Value)
#define CCX_RPT_GET_RTS_RETRY_COUNT(__pC2H)    GET_C2H_FIELD(__pC2H + 0X8, 24, 4)
#define CCX_RPT_SET_RTS_RETRY_COUNT(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X8, 24, 4, __Value)
#define CCX_RPT_SET_RTS_RETRY_COUNT_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X8, 24, 4, __Value)
#define CCX_RPT_GET_BMC(__pC2H)    GET_C2H_FIELD(__pC2H + 0X8, 29, 1)
#define CCX_RPT_SET_BMC(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X8, 29, 1, __Value)
#define CCX_RPT_SET_BMC_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X8, 29, 1, __Value)
#define CCX_RPT_GET_TX_STATE(__pC2H)    GET_C2H_FIELD(__pC2H + 0X8, 30, 2)
#define CCX_RPT_SET_TX_STATE(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X8, 30, 2, __Value)
#define CCX_RPT_SET_TX_STATE_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X8, 30, 2, __Value)
#define CCX_RPT_GET_DATA_RETRY_COUNT(__pC2H)    GET_C2H_FIELD(__pC2H + 0XC, 0, 6)
#define CCX_RPT_SET_DATA_RETRY_COUNT(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0XC, 0, 6, __Value)
#define CCX_RPT_SET_DATA_RETRY_COUNT_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0XC, 0, 6, __Value)
#define CCX_RPT_GET_FINAL_DATA_RATE(__pC2H)    GET_C2H_FIELD(__pC2H + 0XC, 8, 7)
#define CCX_RPT_SET_FINAL_DATA_RATE(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0XC, 8, 7, __Value)
#define CCX_RPT_SET_FINAL_DATA_RATE_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0XC, 8, 7, __Value)
#define CCX_RPT_GET_FINAL_SGI(__pC2H)    GET_C2H_FIELD(__pC2H + 0XC, 15, 1)
#define CCX_RPT_SET_FINAL_SGI(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0XC, 15, 1, __Value)
#define CCX_RPT_SET_FINAL_SGI_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0XC, 15, 1, __Value)
#define CCX_RPT_GET_RF_CH_NUM(__pC2H)    GET_C2H_FIELD(__pC2H + 0XC, 16, 10)
#define CCX_RPT_SET_RF_CH_NUM(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0XC, 16, 10, __Value)
#define CCX_RPT_SET_RF_CH_NUM_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0XC, 16, 10, __Value)
#define CCX_RPT_GET_SC(__pC2H)    GET_C2H_FIELD(__pC2H + 0XC, 26, 4)
#define CCX_RPT_SET_SC(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0XC, 26, 4, __Value)
#define CCX_RPT_SET_SC_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0XC, 26, 4, __Value)
#define CCX_RPT_GET_BW(__pC2H)    GET_C2H_FIELD(__pC2H + 0XC, 30, 2)
#define CCX_RPT_SET_BW(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0XC, 30, 2, __Value)
#define CCX_RPT_SET_BW_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0XC, 30, 2, __Value)
#define FW_DBG_MSG_GET_CMD_ID(__pC2H)    GET_C2H_FIELD(__pC2H + 0X00, 0, 8)
#define FW_DBG_MSG_SET_CMD_ID(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X00, 0, 8, __Value)
#define FW_DBG_MSG_SET_CMD_ID_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X00, 0, 8, __Value)
#define FW_DBG_MSG_GET_C2H_SUB_CMD_ID(__pC2H)    GET_C2H_FIELD(__pC2H + 0X00, 16, 8)
#define FW_DBG_MSG_SET_C2H_SUB_CMD_ID(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X00, 16, 8, __Value)
#define FW_DBG_MSG_SET_C2H_SUB_CMD_ID_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X00, 16, 8, __Value)
#define FW_DBG_MSG_GET_FULL(__pC2H)    GET_C2H_FIELD(__pC2H + 0X00, 24, 1)
#define FW_DBG_MSG_SET_FULL(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X00, 24, 1, __Value)
#define FW_DBG_MSG_SET_FULL_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X00, 24, 1, __Value)
#define FW_DBG_MSG_GET_OWN(__pC2H)    GET_C2H_FIELD(__pC2H + 0X00, 31, 1)
#define FW_DBG_MSG_SET_OWN(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X00, 31, 1, __Value)
#define FW_DBG_MSG_SET_OWN_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X00, 31, 1, __Value)
#define FW_FWCTRL_RPT_GET_EVT_TYPE(__pC2H)    GET_C2H_FIELD(__pC2H + 0X00, 0, 8)
#define FW_FWCTRL_RPT_SET_EVT_TYPE(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X00, 0, 8, __Value)
#define FW_FWCTRL_RPT_SET_EVT_TYPE_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X00, 0, 8, __Value)
#define FW_FWCTRL_RPT_GET_LENGTH(__pC2H)    GET_C2H_FIELD(__pC2H + 0X00, 8, 8)
#define FW_FWCTRL_RPT_SET_LENGTH(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X00, 8, 8, __Value)
#define FW_FWCTRL_RPT_SET_LENGTH_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X00, 8, 8, __Value)
#define FW_FWCTRL_RPT_GET_SEQ_NUM(__pC2H)    GET_C2H_FIELD(__pC2H + 0X00, 16, 8)
#define FW_FWCTRL_RPT_SET_SEQ_NUM(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X00, 16, 8, __Value)
#define FW_FWCTRL_RPT_SET_SEQ_NUM_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X00, 16, 8, __Value)
#define FW_FWCTRL_RPT_GET_IS_ACK(__pC2H)    GET_C2H_FIELD(__pC2H + 0X00, 24, 1)
#define FW_FWCTRL_RPT_SET_IS_ACK(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X00, 24, 1, __Value)
#define FW_FWCTRL_RPT_SET_IS_ACK_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X00, 24, 1, __Value)
#define FW_FWCTRL_RPT_GET_MORE_CONTENT(__pC2H)    GET_C2H_FIELD(__pC2H + 0X00, 25, 1)
#define FW_FWCTRL_RPT_SET_MORE_CONTENT(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X00, 25, 1, __Value)
#define FW_FWCTRL_RPT_SET_MORE_CONTENT_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X00, 25, 1, __Value)
#define FW_FWCTRL_RPT_GET_CONTENT_INDEX(__pC2H)    GET_C2H_FIELD(__pC2H + 0X00, 26, 6)
#define FW_FWCTRL_RPT_SET_CONTENT_INDEX(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X00, 26, 6, __Value)
#define FW_FWCTRL_RPT_SET_CONTENT_INDEX_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X00, 26, 6, __Value)
#define FW_FWCTRL_RPT_GET_CLASS_ID(__pC2H)    GET_C2H_FIELD(__pC2H + 0X04, 0, 8)
#define FW_FWCTRL_RPT_SET_CLASS_ID(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X04, 0, 8, __Value)
#define FW_FWCTRL_RPT_SET_CLASS_ID_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X04, 0, 8, __Value)
#define FW_FWCTRL_RPT_GET_CONTENT(__pC2H)    GET_C2H_FIELD(__pC2H + 0X04, 16, 16)
#define FW_FWCTRL_RPT_SET_CONTENT(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X04, 16, 16, __Value)
#define FW_FWCTRL_RPT_SET_CONTENT_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X04, 16, 16, __Value)
#define H2C_LOOPBACK_ACK_GET_H2C_BYTE_0(__pC2H)    GET_C2H_FIELD(__pC2H + 0X04, 0, 8)
#define H2C_LOOPBACK_ACK_SET_H2C_BYTE_0(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X04, 0, 8, __Value)
#define H2C_LOOPBACK_ACK_SET_H2C_BYTE_0_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X04, 0, 8, __Value)
#define H2C_LOOPBACK_ACK_GET_H2C_BYTE_1(__pC2H)    GET_C2H_FIELD(__pC2H + 0X04, 8, 8)
#define H2C_LOOPBACK_ACK_SET_H2C_BYTE_1(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X04, 8, 8, __Value)
#define H2C_LOOPBACK_ACK_SET_H2C_BYTE_1_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X04, 8, 8, __Value)
#define H2C_LOOPBACK_ACK_GET_H2C_BYTE_2(__pC2H)    GET_C2H_FIELD(__pC2H + 0X04, 16, 8)
#define H2C_LOOPBACK_ACK_SET_H2C_BYTE_2(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X04, 16, 8, __Value)
#define H2C_LOOPBACK_ACK_SET_H2C_BYTE_2_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X04, 16, 8, __Value)
#define H2C_LOOPBACK_ACK_GET_H2C_BYTE_3(__pC2H)    GET_C2H_FIELD(__pC2H + 0X04, 24, 8)
#define H2C_LOOPBACK_ACK_SET_H2C_BYTE_3(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X04, 24, 8, __Value)
#define H2C_LOOPBACK_ACK_SET_H2C_BYTE_3_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X04, 24, 8, __Value)
#define H2C_LOOPBACK_ACK_GET_H2C_BYTE_4(__pC2H)    GET_C2H_FIELD(__pC2H + 0X8, 0, 8)
#define H2C_LOOPBACK_ACK_SET_H2C_BYTE_4(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X8, 0, 8, __Value)
#define H2C_LOOPBACK_ACK_SET_H2C_BYTE_4_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X8, 0, 8, __Value)
#define H2C_LOOPBACK_ACK_GET_H2C_BYTE_5(__pC2H)    GET_C2H_FIELD(__pC2H + 0X8, 8, 8)
#define H2C_LOOPBACK_ACK_SET_H2C_BYTE_5(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X8, 8, 8, __Value)
#define H2C_LOOPBACK_ACK_SET_H2C_BYTE_5_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X8, 8, 8, __Value)
#define H2C_LOOPBACK_ACK_GET_H2C_BYTE_6(__pC2H)    GET_C2H_FIELD(__pC2H + 0X8, 16, 8)
#define H2C_LOOPBACK_ACK_SET_H2C_BYTE_6(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X8, 16, 8, __Value)
#define H2C_LOOPBACK_ACK_SET_H2C_BYTE_6_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X8, 16, 8, __Value)
#define H2C_LOOPBACK_ACK_GET_H2C_BYTE_7(__pC2H)    GET_C2H_FIELD(__pC2H + 0X8, 24, 8)
#define H2C_LOOPBACK_ACK_SET_H2C_BYTE_7(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X8, 24, 8, __Value)
#define H2C_LOOPBACK_ACK_SET_H2C_BYTE_7_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X8, 24, 8, __Value)
#define FWCMD_LOOPBACK_ACK_GET_H2C_BYTE_0(__pC2H)    GET_C2H_FIELD(__pC2H + 0X04, 0, 8)
#define FWCMD_LOOPBACK_ACK_SET_H2C_BYTE_0(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X04, 0, 8, __Value)
#define FWCMD_LOOPBACK_ACK_SET_H2C_BYTE_0_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X04, 0, 8, __Value)
#define FWCMD_LOOPBACK_ACK_GET_H2C_BYTE_1(__pC2H)    GET_C2H_FIELD(__pC2H + 0X04, 8, 8)
#define FWCMD_LOOPBACK_ACK_SET_H2C_BYTE_1(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X04, 8, 8, __Value)
#define FWCMD_LOOPBACK_ACK_SET_H2C_BYTE_1_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X04, 8, 8, __Value)
#define FWCMD_LOOPBACK_ACK_GET_H2C_BYTE_2(__pC2H)    GET_C2H_FIELD(__pC2H + 0X04, 16, 8)
#define FWCMD_LOOPBACK_ACK_SET_H2C_BYTE_2(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X04, 16, 8, __Value)
#define FWCMD_LOOPBACK_ACK_SET_H2C_BYTE_2_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X04, 16, 8, __Value)
#define FWCMD_LOOPBACK_ACK_GET_H2C_BYTE_3(__pC2H)    GET_C2H_FIELD(__pC2H + 0X04, 24, 8)
#define FWCMD_LOOPBACK_ACK_SET_H2C_BYTE_3(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X04, 24, 8, __Value)
#define FWCMD_LOOPBACK_ACK_SET_H2C_BYTE_3_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X04, 24, 8, __Value)
#define FWCMD_LOOPBACK_ACK_GET_H2C_BYTE_4(__pC2H)    GET_C2H_FIELD(__pC2H + 0X8, 0, 8)
#define FWCMD_LOOPBACK_ACK_SET_H2C_BYTE_4(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X8, 0, 8, __Value)
#define FWCMD_LOOPBACK_ACK_SET_H2C_BYTE_4_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X8, 0, 8, __Value)
#define FWCMD_LOOPBACK_ACK_GET_H2C_BYTE_5(__pC2H)    GET_C2H_FIELD(__pC2H + 0X8, 8, 8)
#define FWCMD_LOOPBACK_ACK_SET_H2C_BYTE_5(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X8, 8, 8, __Value)
#define FWCMD_LOOPBACK_ACK_SET_H2C_BYTE_5_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X8, 8, 8, __Value)
#define FWCMD_LOOPBACK_ACK_GET_H2C_BYTE_6(__pC2H)    GET_C2H_FIELD(__pC2H + 0X8, 16, 8)
#define FWCMD_LOOPBACK_ACK_SET_H2C_BYTE_6(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X8, 16, 8, __Value)
#define FWCMD_LOOPBACK_ACK_SET_H2C_BYTE_6_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X8, 16, 8, __Value)
#define FWCMD_LOOPBACK_ACK_GET_H2C_BYTE_7(__pC2H)    GET_C2H_FIELD(__pC2H + 0X8, 24, 8)
#define FWCMD_LOOPBACK_ACK_SET_H2C_BYTE_7(__pC2H, __Value)    SET_C2H_FIELD_CLR(__pC2H + 0X8, 24, 8, __Value)
#define FWCMD_LOOPBACK_ACK_SET_H2C_BYTE_7_NO_CLR(__pC2H, __Value)    SET_C2H_FIELD_NO_CLR(__pC2H + 0X8, 24, 8, __Value)
#endif
